<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" th:src="@{/js/jquery-2.1.4.min.js}"></script>
    <script type="text/javascript" th:src="@{/js/bootstrap-3.3.7-dist/js/bootstrap.min.js}"></script>
    <link type="text/css"  rel="stylesheet" th:href="@{/js/bootstrap-3.3.7-dist/css/bootstrap.min.css}">
    <script type="text/javascript" th:src="@{/js/bootstrap-treeview/bootstrap-treeview.min.js}"></script>
    <link type="text/css"  rel="stylesheet" th:href="@{/js/bootstrap-treeview/bootstrap-treeview.min.css}">
    <script type="text/javascript" th:src="@{/js/bootStrap-addTabs/bootstrap.addtabs.min.js}"></script>
    <link type="text/css"  rel="stylesheet" th:href="@{/js/bootStrap-addTabs/bootstrap.addtabs.css}">
    <script type="text/javascript" th:src="@{/js/bootstrap-table/bootstrap-table.js}"></script>
    <link type="text/css"  rel="stylesheet" th:href="@{/js/bootstrap-table/bootstrap-table.css}">
    <script type="text/javascript" th:src="@{/js/bootstrap-fileinput/js/fileinput.min.js}"></script>
    <script type="text/javascript" th:src="@{/js/bootstrap-bootbox/bootbox.js}"></script>
    <script type="text/javascript" th:src="@{/js/bootstrap-fileinput/js/locales/zh.js}"></script>
    <link type="text/css"  rel="stylesheet" th:href="@{/js/bootstrap-fileinput/css/fileinput.min.css}">
</head>
<body>
<table id="table"></table>
</body>
<script type="text/javascript">
    $("#table").bootstrapTable({
        url:"../gyc/getList2",
        columns:[

            {field:'slideshowId',title:'轮播图ID'},
            {field:'slideshowImg',title:'轮播图',formatter:function(value,row,index){
                    return '<img  src='+value+' width="50" height="50"/> ';
                }},
            {field:'commodityId',title:'商品ID'},
            {field:'slideshowInfo',title:'轮播图描述'},
            {field:'groundingshow',title:'上下架轮播图',formatter:function(value,row){
                    let str = "";
                    if(value===0){
                        return "上架"
                    }else if(value===1){
                        return "下架";
                    }}},
            {field:'cz',title:'操作',formatter:function(value,row){
                    var str = "";
                    str += "<a href='javascript:upstatus("+row.slideshowId+")'>恢复</a>";
                    return str;
                }},

        ],
        pagination:true,
        pageSize:2,
        pageList:[2,4,6,8,10],
        sidePagination : 'client',//server:服务器端分页{rows:[],total:10}|client
//：前端分页 [{},{}]
    })

    //恢复
    function upstatus(slideshowId){
        $.ajax({
            url:"../gyc/upstatus",
            data:{slideshowId:slideshowId},
            success:function(){
                $("#table").bootstrapTable('refresh');//成功后刷新表格
            }
        })
    }








</script>
</html>